using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using GameBase;
using MilitaryPluginInterface;

namespace MilitaryPluginTank
{
    public class MilitaryPlugin : Military, IMilitary
    {
        public override void init(string imgStr, Vector2 pos)
        {
            base.init(imgStr, pos);

            _health.MaxHealth = 300;
            _health.Health = 300;
            _rangeAttack = 180;
            _strengthAttack = 25;
            _defend = 10;
            _targetPosition = pos;
            _speed = 2f;
            _delay = 200;
            _produceTime = 10;
            _scale = 1;

            _idle = new LoopSprite(GameBase.Texture2DHelper.loadTexture2DFromDLL(this, @"_idle"), 7, pos, _scale, _delay);
            _walk = new LoopSprite(GameBase.Texture2DHelper.loadTexture2DFromDLL(this, @"_walk"), 8, pos, _scale, _delay);
            _attack = new LoopSprite(GameBase.Texture2DHelper.loadTexture2DFromDLL(this, @"_attack"), 7, pos, _scale, _delay);
            _die = new OneTimeSprite(GameBase.Texture2DHelper.loadTexture2DFromDLL(this, @"_die"), 6, pos, _scale, _delay);
            Bullet = new LoopSprite(GameBase.Texture2DHelper.loadTexture2DFromDLL(this, @"bullet_tank"), 8, pos, 0.8f, 150);
            _health.Width = (int)(_idle.LstTexture[0].Width * _idle.Scale);
            _health.Position = pos;

            IsRight = false;

            idle();
        }

        public override Object clone()
        {
            MilitaryPluginTank.MilitaryPlugin newTank = new MilitaryPluginTank.MilitaryPlugin();
            newTank.init(_imgStr, Position);
            return newTank;
        }

        public override string getName()
        {
            return @"tank";
        }
    }
}
